package edu.wit.system.domain.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import edu.wit.common.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * 
 *
 * @author yyh
 * @email 664287382@qq.com
 * @date 2021-05-26 11:45:36
 */
@Getter
@Setter
@ApiModel(value = "返回类")
public class AffairsWorkflowDto implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@JsonSerialize(using=ToStringSerializer.class)
	@ApiModelProperty(value = "流程ID")
	private Long workflowId;
	/**
	 * 
	 */
	@ApiModelProperty(value = "流程类型")
	private String workflowType;
	/**
	 * 
	 */
	@ApiModelProperty(value = "流程名称")
	private String workflowName;
	/**
	 * 
	 */
	@ApiModelProperty(value = "流程描述")
	private String workflowRemark;
	/**
	 * 
	 */
	@ApiModelProperty(value = "流程状态")
	private String workflowStatus;
	/**
	 * 劳务公司id
	 */
	private String corporation;

	/**
	 * 劳务公司名称
	 */
	private String corpName;

	/**
	 * 项目ID
	 */
	@JsonSerialize(using=ToStringSerializer.class)
	private Long projectId;
	

	private String workflowTypeText;
	
	private String workflowStatusText;
	
	public String getWorkflowTypeText() {
		if(StringUtils.isNotBlank(getWorkflowType())) {
//			setWorkflowTypeText(DicUtil.viewByCode(AffairsConstant.WORKFLOW_TYPE, getWorkflowType()));
			//todo 从redis缓存取工作流类似设置
		}
		return workflowTypeText;
	}
	
	public String getWorkflowStatusText() {
		if(StringUtils.isNotBlank(getWorkflowStatus())) {
//			setWorkflowStatusText(DicUtil.viewByCode(AffairsConstant.WORKFLOW_STATUS, getWorkflowStatus()));
			//todo 从redis缓存取工作流类似设置
		}
		return workflowStatusText;
	}
	
	/**
	 * 流程节点列表
	 */
	private List<AffairsWorkflowNodeDto> nodeList;

	@Override
	public String toString() {
		return "AffairsWorkflowDto{" +
				"workflowId=" + workflowId +
				", workflowType='" + workflowType + '\'' +
				", workflowName='" + workflowName + '\'' +
				", workflowRemark='" + workflowRemark + '\'' +
				", workflowStatus='" + workflowStatus + '\'' +
				", projectId=" + projectId +
				", workflowTypeText='" + workflowTypeText + '\'' +
				", workflowStatusText='" + workflowStatusText + '\'' +
				", nodeList=" + nodeList +
				'}';
	}
}

